<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>event</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <button v-on:click="count+=Math.random()">random number</button>
        <p>自动生成的随机数{{count}}</p>
        <input type="text" v-on:keyup.enter="submit">
        <div>
            <div v-on:click="doParent">
                <button v-on:click="doThis">事件冒泡</button>
                <button v-on:click.stop="doThis">阻止事件冒泡</button>
            </div>
        </div>
    </div>
    <script>
        var vm =new Vue({
            el:'#app',
            data:{
                count:0
            },
            methods:{
                submit(){
                    consol.log('submit input!')
                },
                doParent(){
                    console.log("farther element click!")
                },
                doThis(){
                    console.log('son element click!')
                }
            }
        })
    </script>
</body>
</html>